.TH "libggi" 7 "2008-02-20" "libggi-current" GGI
.SH NAME
\fBlibggi\fR : A fast, simple, small and flexible user-space graphics library
.SH DESCRIPTION
LibGGI is a fast, simple, small and flexible user-space graphics
library developed by the GGI Project. It attempts to abstract the
many different graphics output systems existing under Unix (and in the
future, other platforms). The support for all of these different types
of displays and hardware are provided by dynamically-loaded
mini-libraries.
LibGGI can transparently (to the LibGGI-using application) display
graphics on an X window, under SVGAlib, fbcon (Linux framebuffer
driver), or the glide library, through their respective graphics
drivers, or targets.  There are also some other targets which display
through another target, such as multi to display simultaneously on
multiple displays at once, and tile to tile your display to different
monitors.

LibGGI supports acceleration of graphics primitives where possible.

LibGGI is a very generic piece of software, that will run on about
every platform that has remotely heard of POSIX (ports to other
systems such as Win32 are available, too) and on many display subsystems.
.SH ENVIRONMENT VARIABLES
The following outlines the environment variables, intended for the
user, which affect the behaviour of LibGGI:
.TP
\fBDISPLAY\fR
If set, LibGGI assumes that you want to use the X target.  This
setting is overridden by the \fBGGI_DISPLAY\fR variable.

.TP
\fBGGI_DISPLAY\fR
Specifies the default target used when the application calls
\f(CWggiOpen(3)\fR with \fBNULL\fR argument.

The default target is specified using a target-spec:
\f(CWtarget:targetargs\fR where \fItarget\fR is the name of the target,
and \fItargetargs\fR are any target-specific arguments.

If neither this variable nor \fBDISPLAY\fR is set, then the following
targets are tried in order until one works: \fBfbdev\fR, \fBsvga\fR, \fBaa\fR

.TP
\fBGGI_INPUT_target_n\fR, \fBGGI_INPUT_target\fR, \fBGGI_INPUT\fR
\fBGGI_INPUT_target\fR specifies extra LibGII input sources and/or
filters for visuals using \fItarget\fR

Multiple inputs can be specified by enclosing each
input-spec in parentheses and separating them with semicolons:
\f(CW(i1):(i2):...\fR

The inputs specified by \fBGGI_INPUT_target_n\fR are only opened at the
\fIn\fR'th call of \f(CWggiOpen(3)\fR. This is used for misbehaving
applications that do not allow the user to specify inputs for the
different targets that it opens.

The \fBGGI_INPUT\fR variable specifies input settings for all other
targets not specified using the other two variable forms.

.TP
\fBGGI_DEFMODE\fR   
Specifies the default mode, which is used for mode negotiation with
LibGGI applications.  Specifically, when \fBGGI_AUTO\fR or \fBGT_AUTO\fR
are specified in a mode setting call they will be replaced with
values from \fBGGI_DEFMODE\fR before calling the target's own
\fBggiSetMode(3)\fR implementation.

The format is: (all on one line)
\f(CWS w x h x depth V w x h D w x h F frames [scheme depth size subscheme]\fR
Anything and everything can be omitted, except tokens indicating
what the next token is.

Any omitted values default to \fBGGI_AUTO\fR (or \fBGT_AUTO\fR for the
graphtype).  Whitespace and '.' symbols are ignored.  Character
tokens are case-insensitive.  If certain values are not possible,
they are overridden by the target.
.RS
.TP
S
Denotes the visible size of the visual.  Totally optional, as
dimensions without a specifier are considered to be the visible
dimensions.

\fIw\fR and \fIh\fR are the width and height in pixels.

.TP
V
Denotes virtual size, the total drawing area available to the
application.  The virtual size must be equal or greater than
the visible size.

.TP
D
Denotes the number of dots per pixel.  For graphic modes, this
is always 1x1, and for text modes, this is the size of the
character cell.

.TP
F
Denotes number of frames available to the
application. Applications can switch between different frames
for double-buffering, etc.

.TP
[]
Delimits the graphic type.
.RS
.TP
\fIscheme\fR
One of:
.RS
.IP \(bu 4
C : GT_TRUECOLOR
.IP \(bu 4
P : GT_PALETTE
.IP \(bu 4
K : GT_GREYSCALE
.IP \(bu 4
T : GT_TEXT
.PP

.RE
.TP
\fIdepth\fR
Pixel depth in number of bits.

.TP
\fIsize\fR   
Size of pixel in number of bits, including padding.

.TP
\fIsubscheme\fR
List of:
.RS
.IP \(bu 4
R : GT_SUB_REVERSE_ENDIAN
.IP \(bu 4
H : GT_SUB_HIGHBIT_RIGHT
.IP \(bu 4
G : GT_SUB_PACKED_GETPUT
.PP

.RE
.PP
Instead of \fIscheme\fR, \fIdepth\fR, \fIsize\fR, \fIsubscheme\fR, it
is also possible to specify the graphtype by using one of the
following:
.IP \(bu 4
GT_1BIT
.IP \(bu 4
GT_2BIT
.IP \(bu 4
GT_4BIT
.IP \(bu 4
GT_8BIT
.IP \(bu 4
GT_15BIT
.IP \(bu 4
GT_16BIT
.IP \(bu 4
GT_24BIT
.IP \(bu 4
GT_32BIT
.IP \(bu 4
GT_TEXT16
.IP \(bu 4
GT_TEXT32
.PP

.RE
.PP

.RE
.TP
\fBGGI_DEBUG\fR
The debugging level for LibGGI:
.RS
.TP
0 or unset
debug output is off; debugging is off

.TP
255
all debug output is on

.PP
You may also bitwise-or any of the following together:
.IP \(bu 4
2 : debug core
.IP \(bu 4
4 : debug mode setting
.IP \(bu 4
8 : debug color handling
.IP \(bu 4
16 : debug drawing
.IP \(bu 4
32 : misc debugging output
.IP \(bu 4
64 : debug dynamic library handling
.IP \(bu 4
128 : debug event handling
.PP
The debugging output can be quite verbose and in most cases you
should redirect stderr so that it does not interfere with your
program's output.

.RE
.TP
\fBGGI_DEBUGSYNC\fR
Turn on synchronous debugging output, flushing the output buffers
before returning from \fBDPRINT\fR calls.

.TP
\fBGGI_CONFDIR\fR
Override compiled-in path to global config files (Win32 only,
but not Cygwin).

.TP
\fBGGI_NEWVT\fR
If set, causes a new virtual console to be allocated for some
Linux-console-based targets (currently \fBfbdev\fR and \fBglide\fR).

.TP
\fBGGI_MANSYNC_FPS\fR
This variable specifies the framerate for targets emulating
synchronous mode. The default is 20fps.  If you are experiencing
problems with the X target over relatively slow remote connections
it might be due to connection overload. You might want to try with
a lower \fBGGI_MANSYNC_FPS\fR setting.

.PP
.SH EXAMPLES
Example \fBGGI_DISPLAY\fR settings:

.nb
.nf
# see ASCII art flying GGIs

$ GGI_DISPLAY=aa ./flying_ggis


# see demo on both machine "crono" next door and local
# X at the same time

$ GGI_DISPLAY=multi:(Xlib:crono:0.0):(X::0.0) ./demo
.fi

Example \fBGGI_INPUT\fR string:

.nb
.nf
$ export GGI_INPUT=linux-mouse:auto

# for "multi" target only

$ export GGI_INPUT_multi=linux-mouse:auto
.fi

Examples of \fBGGI_DEFMODE\fR strings:
.IP \(bu 4
\f(CW640x480\fR : just the visible size
.IP \(bu 4
\f(CW640x480#640x960\fR : same size, but double-height virtual screen
.IP \(bu 4
\f(CW#1024x768\fR : only virtual size defined
.IP \(bu 4
\f(CW80x40[T]\fR : (default-fontsized) text mode with 80x40 characters
.IP \(bu 4
\f(CW#x100[T]\fR : text mode with 100 virtual lines
.IP \(bu 4
\f(CW640x400[8]\fR : 640x400 at 8 bits per pixel
.IP \(bu 4
\f(CW640x480[GT_8BIT]\fR : same as above, but palettized
.IP \(bu 4
\f(CW320x200[C15]\fR : 320x200 with 32768 colors (hicolor)
.IP \(bu 4
\f(CW320x200[C/16]\fR : 320x200 with 16-bit pixels (also hicolor)
.IP \(bu 4
\f(CW320x200[C24/32]\fR, \f(CW320x200[GT_32BIT]\fR : 320x200, with 32-bit pixels for 16777216 colors (truecolor)
.IP \(bu 4
\f(CW640x480F2[GT_16BIT]\fR : 16-bit-color 640x480 with two buffers
.PP
.SH SEE ALSO
\f(CWlibgii(7)\fR, \f(CWggiInit(3)\fR,
\f(CWdisplay-aa(7)\fR, \f(CWdisplay-directx(7)\fR, \f(CWdisplay-fbdev(7)\fR,
\f(CWdisplay-file(7)\fR, \f(CWdisplay-glide(7)\fR, \f(CWdisplay-ipc(7)\fR,
\f(CWdisplay-kgi(7)\fR, \f(CWdisplay-memory(7)\fR, \f(CWdisplay-monotext(7)\fR,
\f(CWdisplay-multi(7)\fR, \f(CWdisplay-palemu(7)\fR, \f(CWdisplay-quartz(7)\fR,
\f(CWdisplay-sub(7)\fR, \f(CWdisplay-svgalib(7)\fR, \f(CWdisplay-tele(7)\fR,
\f(CWdisplay-terminfo(7)\fR, \f(CWdisplay-tile(7)\fR, \f(CWdisplay-trueemu(7)\fR,
\f(CWdisplay-vcsa(7)\fR, \f(CWdisplay-vgl(7)\fR, \f(CWdisplay-vnc(7)\fR,
\f(CWdisplay-x(7)\fR
